package com.hd.tiyu.yuejian.Model;

import com.hd.tiyu.yuejian.JavaBean.Login;
import com.hd.tiyu.yuejian.JavaBean.OrderDetail;
import com.hd.tiyu.yuejian.JavaBean.Register;
import com.hd.tiyu.yuejian.Service.UserService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by love on 2017/9/26.
 */

public class UserModel {
    private Retrofit retrofit;
    public UserModel(){
        retrofit = new Retrofit.Builder()
                .baseUrl("http://172.24.10.175/workout/api.php/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
    public Call<Login> UserLogin( String tel, String password){
        UserService userService=retrofit.create(UserService.class);
        return userService.userLogin(tel,password);

    }

    public Call<Register> Register(String tel,String password){
        UserService userService=retrofit.create(UserService.class);
        return userService.register(tel, password);
    }

    public Call UpdateUname(String uid,String uname){
        UserService userService=retrofit.create(UserService.class);
        return userService.getUpdateName(uid,uname);
    }

    public Call UpdatePass(String uid, String pass){
        UserService userService=retrofit.create(UserService.class);
        return userService.getUpdatePass(uid,pass);
    }

    public Call getGuanZhu(String uid){
        UserService userService=retrofit.create(UserService.class);
        return userService.getUserGuanzhu(uid);
    }

    public Call getPay(String uid,String vstate,String page,String sessionId){
        UserService userService=retrofit.create(UserService.class);
        return userService.getPay(uid,vstate,page,sessionId);
    }

    public Call<OrderDetail> getOrderDetail(String id, String type){
        UserService userService=retrofit.create(UserService.class);
        return userService.getOrderDetail(id, type);
    }


}


